Adaptive grid techniques through a variational approach are applied to two shock problems with exact solutions . more grid points are redistributed in the shock regions in response to numerical solution and thus the shock can be captured successfully . the results show the techniques have excellent qualities in improving accuracy of numerical solution and reducing cpu time 利用变分原理的自适应网格技术被应用到两个有解析解的激波问题上,它能根据问题的求解,在解的大梯度区自动加密网格,从而非常成功地算出了激波。通过分析发现自适应网格技术在提高精度减少运行时间方面显示了优良的性能。